{template 'admin','header'}
<table class="table_form" cellpadding="0" cellspacing="1">
    <caption>{$modelinfo['name']}模型字段管理</caption>
    <tbody>
        <tr>
            <td><a href="{$self_url}?action=field_add&modelid={$modelid}">添加字段</a> | <a href="{$self_url}?action=field_manage&modelid={$modelid}">管理字段</a></td>
        </tr>
    </tbody>
</table>
<form method="post" name="myform" action="{$self_url}?action=field_listorder&modelid={$modelid}" onsubmit="return r_submit(this);">
    <table class="table_list" cellpadding="2" cellspacing="1">
        <caption>{$modelinfo['name']}模型字段管理</caption>
        <tbody>
            <tr class="">
                <th width="50">排序</th>
                <th>字段名</th>
                <th>别名</th>
                <th>类型</th>
                <th width="50">系统</th>
                <th width="50">输入</th>
                <th width="50">列表</th>
                <th width="200">管理操作</th>
            </tr>
            {loop $data $r}
            <tr>
                <td class="align_c"><input name="info[{$r['id']}]" value="{$r['listorder']}" size="3" type="text"></td>
                <td>{$r['field']}</td>
                <td>{$r['name']}</td>
                <td>{$fields[$r['formtype']]}</td>
                <td class="align_c">{if $r['issystem']}<font color="red">√</font>{/if}</td>
                <td class="align_c">{if $r['showedit']}<font color="red">√</font>{/if}</td>
                <td class="align_c">{if $r['showlist']}<font color="red">√</font>{/if}</td>
                <td class="align_c">
                    <a href="{$self_url}?action=field_edit&id={$r['id']}">修改</a> |
                    {if $r['disabled']==0}
                    <a href="javascript:void(0)" onclick="my_request('{format_url("$self_url?action=field_status&status=1&id=".$r['id'])}','确认要禁止该字段吗？')">禁止</a> |
                    {else}
                    <a href="javascript:void(0)" onclick="my_request('{format_url("$self_url?action=field_status&status=0&id=".$r['id'])}','确认要启用该字段吗？')">启用</a> |
                    {/if}
                    {if !$r['issystem']}
                    <a href="javascript:void(0)" onclick="my_request('{format_url("$self_url?action=field_delete&id=".$r['id'])}','将会失去该字段全部数据，是否继续？')">删除</a>
                    {else}
                    <span style="color: rgb(204, 204, 204);">删除</span>
                    {/if}
                </td>
            </tr>
            {/loop}
        </tbody>
    </table>
    <div class="button_box">
        <input class="button_style" name="dosubmit" value=" 排序 " type="submit">
        <input type="button" value="返回" class="button_style" onclick="window.location='{$self_url}'">
    </div>
</form>
{template 'admin','footer'}
